﻿using System.Collections.Generic;
using System.Threading.Tasks;
using System.Web.Http;
using Abp.Application.Services;
using RMM.Core.Entity.Orders;
using RMM.Orders.Dtos;
using Swashbuckle.Swagger.Annotations;

namespace RMM.Orders
{
    public interface IOrderAppService : IApplicationService
    {
        /// <summary>
        /// 订单号获取订单信息
        /// </summary>
        /// <param name="orderCode"></param>
        /// <returns></returns>
        [HttpGet]
        [SwaggerResponse(System.Net.HttpStatusCode.OK,Type = typeof(OrderDto))]
        Task<ResultDto> GetOrderAsync(string orderCode);

        /// <summary>
        /// 获取用户订单信息
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="orderStatus">-999所有订单 0待付款 1待服务 2待确定 3待评价 4完成 10取消订单</param>
        /// <returns></returns>
        [HttpGet]
        [SwaggerResponse(System.Net.HttpStatusCode.OK, Type = typeof(List<OrderDto>))]
        Task<ResultDto> GetUserOrderAsync(long userId, int orderStatus);

        /// <summary>
        /// 获取用户未读订单个数
        /// </summary>
        /// <param name="userId"></param>
        /// <returns></returns>
        [HttpGet]
        [SwaggerResponse(System.Net.HttpStatusCode.OK, Type = typeof(List<OrderReadDto>))]
        Task<ResultDto> GetUserOrderReadAsync(long userId);

        /// <summary>
        /// 标记未读订单已读
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="Status"></param>
        /// <returns></returns>
        [HttpGet]
        Task<ResultDto> SetUserOrderReadAsync(long userId, int Status);

        /// <summary>
        /// 创建订单
        /// </summary>
        /// <param name="createOrderDto"></param>
        /// <returns></returns>
        [HttpPost]
        Task<ResultDto> CreateOrderAsync(CreateOrderDto createOrderDto);

        /// <summary>
        /// 快速下单
        /// </summary>
        /// <param name="dto"></param>
        /// <returns></returns>
        [HttpPost]
        Task<ResultDto> CreateOrderDistanceAsync(CreateOrderDistanceDto dto);

        /// <summary>
        /// 修改订单状态 3待评价 10取消订单
        /// </summary>
        /// <param name="orderCode"></param>
        /// <param name="status"></param>
        /// <returns></returns>
        [HttpPost]
        Task<ResultDto> CompleteOrderAsync(string orderCode, int status);
    }
}